<?php

class Analyze {

        public $Analyze = array();
        protected $Where;
        protected $tablePx;

        function __construct($config = array(), $tablePx = '') {
                $this->setAnalyze($config);
                $this->tablePx = $tablePx ? $tablePx : C("DB_PREFIX");
        }

        /**
         * 设置参数
         */
        public function setAnalyze($config) {
                $this->Analyze = array_merge($this->Analyze, $config);
        }

        /**
         * where 解析
         */
        public function whereAnaly($where = "") {
                $trueWhere = str_replace("@#_", $this->tablePx, trim($where));
                if (strlen($trueWhere) == 0)
                        return;
                if (FALSE !== strpos($trueWhere, "array")) {
                        eval("\$trueWhere=" . $trueWhere . ";");
                }
                return $trueWhere;
        }

}

